﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace gui
{
    public partial class History : Form
    {
        private Config dataToConfigFile;

        public History()
        {
            InitializeComponent();
            loadHistory();
            
        }

        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e)
        {

        }
        private void loadHistory()
        {
            DataBase db = new DataBase();
            dataToConfigFile = new Config();

            dataToConfigFile.GetConfig();

            // Соединяемся с базой
            db.OpenConnection();

            // получаем данные из базы
            //db.getData();
            SqlResult sr = new SqlResult();

            var res = db.getData();
            foreach (var data in res)
            {
                for (int i = 0; i < data.ColumnCount-1; ++i)
                {
                    richTextBox1.AppendText(data.Values[i] + " : ");
                    Console.WriteLine("{0}",data.Values[i]);
                    for (int j = 1; j <= 1; j++)
                    {
                        richTextBox1.AppendText(data.Values[j] + "\n");
                        //Console.WriteLine("{0}",data.Values[j] + "/n");
                    }
                }
            }
        }
    }
}
